package com.jgzx.domain;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author jackesy
 * @className: ListDTO
 * @description: 列表请求DTO
 * @create 2020/9/10 17:40
 **/
@Data
@NoArgsConstructor
public class ListDTO<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "数据集合")
    private List<T> records = new ArrayList<>();

    public void setRecords(List<T> records) {
        if (records != null && records.size() > 0) {
            this.records = records;
        }
    }

    public ListDTO(List<T> records) {
        if (records != null && records.size() > 0) {
            this.records = records;
        }
    }
}
